

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/IKKIS_LOGO.png">
  <link rel="icon" href="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/IKKIS_LOGO.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="Ikki">
  <meta name="keywords" content="">
  
    <meta name="description" content="1. 进程管理 1.1 进程   进程是正在执行的一个程序或命令，每一个进程都是一个运行的实体，都有自己的地址空间并且用一定的系统资源   进程就是正在执行的某个程序  1.2 进程管理简介   判断服务器的状态   查看系统中的所有进程   杀死进程，只有无法关闭才要杀死进程  1.3 ps - 进程的查看命令   ps aux 查看系统中所有进程，使用BSD操作系统格式   ps -le 查看">
<meta property="og:type" content="article">
<meta property="og:title" content="07.进程管理">
<meta property="og:url" content="http://81.68.132.127/2022/10/24/dev_ops/linux/%E8%BF%9B%E7%A8%8B%E7%AE%A1%E7%90%86/index.html">
<meta property="og:site_name" content="IKKI">
<meta property="og:description" content="1. 进程管理 1.1 进程   进程是正在执行的一个程序或命令，每一个进程都是一个运行的实体，都有自己的地址空间并且用一定的系统资源   进程就是正在执行的某个程序  1.2 进程管理简介   判断服务器的状态   查看系统中的所有进程   杀死进程，只有无法关闭才要杀死进程  1.3 ps - 进程的查看命令   ps aux 查看系统中所有进程，使用BSD操作系统格式   ps -le 查看">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/beijing/iTab-e7kejr.jpeg">
<meta property="article:published_time" content="2022-10-23T23:15:06.000Z">
<meta property="article:modified_time" content="2022-10-24T09:52:48.191Z">
<meta property="article:author" content="Ikki">
<meta property="article:tag" content="运维">
<meta property="article:tag" content="linux">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/beijing/iTab-e7kejr.jpeg">
  
  
    <meta name="referrer" content="no-referrer-when-downgrade">
  
  
  <title>07.进程管理 - IKKI</title>

  <link  rel="stylesheet" href="https://lib.baomitu.com/twitter-bootstrap/4.6.1/css/bootstrap.min.css" />



  <link  rel="stylesheet" href="https://lib.baomitu.com/github-markdown-css/4.0.0/github-markdown.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/hint.css/2.7.0/hint.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.css" />



<!-- 主题依赖的图标库，不要自行修改 -->
<!-- Do not modify the link that theme dependent icons -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_hj8rtnfg7um.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/css/main.css" />


  <link id="highlight-css" rel="stylesheet" href="/css/highlight.css" />
  
    <link id="highlight-css-dark" rel="stylesheet" href="/css/highlight-dark.css" />
  



  
<link rel="stylesheet" href="/fluid/css/fluid-extention.css">
<link rel="stylesheet" href="/fluid/css/nihao.css">



  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    Fluid.ctx = Object.assign({}, Fluid.ctx)
    var CONFIG = {"hostname":"81.68.132.127","root":"/","version":"1.9.3","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false,"scope":[]},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"left","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"code_language":{"enable":true,"default":"TEXT"},"copy_btn":true,"image_caption":{"enable":true},"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"placement":"left","headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":3},"lazyload":{"enable":true,"loading_img":"https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"follow_dnt":true,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/local-search.xml"};

    if (CONFIG.web_analytics.follow_dnt) {
      var dntVal = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
      Fluid.ctx.dnt = dntVal && (dntVal.startsWith('1') || dntVal.startsWith('yes') || dntVal.startsWith('on'));
    }
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
  


  
<meta name="generator" content="Hexo 5.4.2"></head>


<body>
  

  <header>
    

<div class="header-inner" style="height: 100vh;">
  <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/">
      <strong>Ikki-BUG制造者</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              &nbsp;<i class="iconfont icon-search"></i>&nbsp;
            </a>
          </li>
          
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

  

<div id="banner" class="banner" parallax=true
     style="background: url('http://image.ikki0603.cn') no-repeat center center; background-size: cover;">
  <div class="full-bg-img">
    <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
      <div class="banner-text text-center fade-in-up">
        <div class="h2">
          
            <span id="subtitle" data-typed-text="07.进程管理"></span>
          
        </div>

        
          
  <div class="mt-3">
    
    
      <span class="post-meta">
        <i class="iconfont icon-date-fill" aria-hidden="true"></i>
        <time datetime="2022-10-24 07:15" pubdate>
          2022年10月24日 早上
        </time>
      </span>
    
  </div>

  <div class="mt-1">
    
      <span class="post-meta mr-2">
        <i class="iconfont icon-chart"></i>
        
          4.5k 字
        
      </span>
    

    
      <span class="post-meta mr-2">
        <i class="iconfont icon-clock-fill"></i>
        
        
        
          38 分钟
        
      </span>
    

    
    
      
        <span id="busuanzi_container_page_pv" style="display: none">
          <i class="iconfont icon-eye" aria-hidden="true"></i>
          <span id="busuanzi_value_page_pv"></span> 次
        </span>
        
      
    
  </div>


        
      </div>

      
        <div class="scroll-down-bar">
          <i class="iconfont icon-arrowdown"></i>
        </div>
      
    </div>
  </div>
</div>

</div>

  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="side-col d-none d-lg-block col-lg-2">
      
  <aside class="sidebar" style="padding-left: 2rem; margin-right: -1rem">
    <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div class="toc-body" id="toc-body"></div>
</div>



  </aside>


    </div>

    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">07.进程管理</h1>
            
              <p class="note note-info">
                
                  
                    本文最后更新于：2022年10月24日 下午
                  
                
              </p>
            
            
              <div class="markdown-body">
                
                <h2 id="1-进程管理"><a href="#1-进程管理" class="headerlink" title="1. 进程管理 "></a>1. 进程管理 </h2><h3 id="1-1-进程"><a href="#1-1-进程" class="headerlink" title="1.1 进程"></a>1.1 进程</h3><ul>
<li>  进程是正在执行的一个程序或命令，每一个进程都是一个运行的实体，都有自己的地址空间并且用一定的系统资源</li>
<li>  进程就是正在执行的某个程序</li>
</ul>
<h3 id="1-2-进程管理简介"><a href="#1-2-进程管理简介" class="headerlink" title="1.2 进程管理简介"></a>1.2 进程管理简介</h3><ul>
<li>  判断服务器的状态</li>
<li>  查看系统中的所有进程</li>
<li>  杀死进程，只有无法关闭才要杀死进程</li>
</ul>
<h3 id="1-3-ps-进程的查看命令"><a href="#1-3-ps-进程的查看命令" class="headerlink" title="1.3 ps - 进程的查看命令"></a>1.3 ps - 进程的查看命令</h3><ul>
<li>  <code>ps aux</code> 查看系统中所有进程，使用BSD操作系统格式</li>
<li>  <code>ps -le</code> 查看系统中所有进程，使用Linux标准格式</li>
</ul>
<h4 id="1-3-1-选项"><a href="#1-3-1-选项" class="headerlink" title="1.3.1 选项"></a>1.3.1 选项</h4><table>
<thead>
<tr>
<th>参数</th>
<th>含义</th>
</tr>
</thead>
<tbody><tr>
<td>-a</td>
<td>显示一个终端的所有进程</td>
</tr>
<tr>
<td>-u</td>
<td>显示进程的归属用户及内存的使用情况</td>
</tr>
<tr>
<td>-x</td>
<td>显示没有控制终端的进程</td>
</tr>
<tr>
<td>-l</td>
<td>长格式显示，显示更详细的信息</td>
</tr>
</tbody></table>
<h4 id="1-3-2-结果字段含义"><a href="#1-3-2-结果字段含义" class="headerlink" title="1.3.2 结果字段含义"></a>1.3.2 结果字段含义</h4><p><img src="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/dev_ops/linux/2022-10-24-16-37-22_ab64901c.png" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload alt="2022-10-24-16-37-22"><br>| 数据 | 含义 |<br>| — | — |<br>| USER-(root) | 该进程是由哪个用户创建的 |<br>| PID(1) | 进程的ID号 |<br>| %CPU-(0.0) | 该进程占用CPU资源的百分比，占用越高说明越消耗系统资源 |<br>| %MEM-(0.3) | 该进程占用物理内存的百分比，占用越高说明越消耗系统资源 |<br>| VSZ-(190988) | 该进程占用虚拟内存的百分比，单位是KB |<br>| RSS-(3588) | 该进程占用实际物理内存大小，单位是KB |<br>| TTY-(?) | 该进程在哪个终端中运行。tty1<del>tty7表示本地控制终端，tty1</del>tty6是字符终端，tty7是图形终端。pts/0~255代表虚拟终端，?表示此终端是系统启动的 |<br>| STAT-(Ss) | 进程状态 R(运行) S(休眠)    T(停止) s(包含子进程) +(位于后台)|<br>| START-(Oct21) | 该进程的启动时间 |<br>| TIME-(0:03) | 该进程占用CPU的运算时间,数值越高说明越消耗系统资源 |<br>| COMMAND-(/usr/lib/systemd/systemd –system –deserialize 22) | 产生此进程的命令名 |</p>
<h3 id="1-4-pstree"><a href="#1-4-pstree" class="headerlink" title="1.4 pstree"></a>1.4 pstree</h3><ul>
<li>pstree [选项]<ul>
<li>  -p 显示进程PID</li>
<li>  -u 显示进程的所属用户</li>
</ul>
</li>
</ul>
<p><img src="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/dev_ops/linux/2022-10-24-16-43-55_f98cda3e.png" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload alt="2022-10-24-16-43-55"></p>
<h3 id="1-5-top-进程的查看"><a href="#1-5-top-进程的查看" class="headerlink" title="1.5 top - 进程的查看"></a>1.5 top - 进程的查看</h3><ul>
<li>  top</li>
</ul>
<figure class="highlight css"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-y3cutelacl5vph"></i><span>css</span><div class="collapse show" id="collapse-y3cutelacl5vph"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs css"><span class="hljs-attribute">top</span> -<span class="hljs-selector-tag">b</span> -n <span class="hljs-number">1</span> &gt; <span class="hljs-attribute">top</span><span class="hljs-selector-class">.txt</span><br></code></pre></td></tr></table></div></figure>
<p><img src="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/dev_ops/linux/2022-10-24-17-06-46_8dd7f75d.png" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload alt="2022-10-24-17-06-46"></p>
<h4 id="1-5-1-选项"><a href="#1-5-1-选项" class="headerlink" title="1.5.1 选项"></a>1.5.1 选项</h4><table>
<thead>
<tr>
<th>选项</th>
<th>含义</th>
</tr>
</thead>
<tbody><tr>
<td>-b</td>
<td>使用批处理模式输出，一般和<code>-n</code>配合使用</td>
</tr>
<tr>
<td>-n</td>
<td>次数，指定top命令执行的次数。一般了<code>-b</code>选项配合使用</td>
</tr>
<tr>
<td>-d</td>
<td>秒数，指定top命令每隔几秒更新。默认是3秒</td>
</tr>
</tbody></table>
<h4 id="1-5-2-交互模式的命令"><a href="#1-5-2-交互模式的命令" class="headerlink" title="1.5.2 交互模式的命令"></a>1.5.2 交互模式的命令</h4><figure class="highlight apache"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-02gw8dlacl5vph"></i><span>apache</span><div class="collapse show" id="collapse-02gw8dlacl5vph"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs apache"><span class="hljs-attribute">top</span> -d <span class="hljs-number">3</span><br></code></pre></td></tr></table></div></figure>
<p><img src="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/dev_ops/linux/2022-10-24-17-27-03_f989ed29.png" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload alt="2022-10-24-17-27-03"></p>
<table>
<thead>
<tr>
<th>选项</th>
<th>含义</th>
</tr>
</thead>
<tbody><tr>
<td>?或h</td>
<td>显示交互模式的帮助</td>
</tr>
<tr>
<td>P</td>
<td>按CPU使用率排序，默认就是此选项</td>
</tr>
<tr>
<td>M</td>
<td>以内存的使用率排序</td>
</tr>
<tr>
<td>N</td>
<td>以PID排序</td>
</tr>
<tr>
<td>q</td>
<td>退出top</td>
</tr>
</tbody></table>
<h4 id="1-5-3-状态栏"><a href="#1-5-3-状态栏" class="headerlink" title="1.5.3 状态栏"></a>1.5.3 状态栏</h4><h5 id="1-5-3-1-第一行为任务队列信息"><a href="#1-5-3-1-第一行为任务队列信息" class="headerlink" title="1.5.3.1 第一行为任务队列信息"></a>1.5.3.1 第一行为任务队列信息</h5><p><img src="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/dev_ops/linux/2022-10-24-17-09-17_883a5c2a.png" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload alt="2022-10-24-17-09-17"></p>
<table>
<thead>
<tr>
<th>内容</th>
<th>说明</th>
</tr>
</thead>
<tbody><tr>
<td>17:05:56</td>
<td>系统的当前时间</td>
</tr>
<tr>
<td>up 3 days,  4:56</td>
<td>系统的运行时间，本机已经运行了3天4小时56分</td>
</tr>
<tr>
<td>2 users</td>
<td>当前登录了二个客户端</td>
</tr>
<tr>
<td>load average: 0.02, 0.03, 0.05</td>
<td>系统在之前1分钟、5分钟、15分钟的平均负载。一般认为小于1小时负载较小，大于1超过负载</td>
</tr>
</tbody></table>
<h5 id="1-5-3-2-第二行为进程信息"><a href="#1-5-3-2-第二行为进程信息" class="headerlink" title="1.5.3.2 第二行为进程信息"></a>1.5.3.2 第二行为进程信息</h5><p><img src="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/dev_ops/linux/2022-10-24-17-10-48_6acc6407.png" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload alt="2022-10-24-17-10-48"></p>
<table>
<thead>
<tr>
<th>内容</th>
<th>说明</th>
</tr>
</thead>
<tbody><tr>
<td>Tasks: 75 total</td>
<td>系统中的进程总数</td>
</tr>
<tr>
<td>1 running</td>
<td>正在运行的进程数</td>
</tr>
<tr>
<td>74 sleeping</td>
<td>睡眠的进程</td>
</tr>
<tr>
<td>0 stopped</td>
<td>正在停止的进程</td>
</tr>
<tr>
<td>0 zombie</td>
<td>僵尸进程。如果不是0的话要进行检查</td>
</tr>
</tbody></table>
<h5 id="1-5-3-3-第三行为CPU信息"><a href="#1-5-3-3-第三行为CPU信息" class="headerlink" title="1.5.3.3 第三行为CPU信息"></a>1.5.3.3 第三行为CPU信息</h5><p><img src="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/dev_ops/linux/2022-10-24-17-11-07_24905246.png" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload alt="2022-10-24-17-11-07"></p>
<table>
<thead>
<tr>
<th>内容</th>
<th>说明</th>
</tr>
</thead>
<tbody><tr>
<td>Cpu(s): 6.2 us</td>
<td>用户模式占用的CPU百分比</td>
</tr>
<tr>
<td>0.0%sy</td>
<td>系统模式占用的CPU百分比</td>
</tr>
<tr>
<td>0.0%ni</td>
<td>改变过优先级的用户进程 占用的CPU百分比</td>
</tr>
<tr>
<td>93.8%id</td>
<td>空闲CPU的CPU百分比</td>
</tr>
<tr>
<td>0.0%wa</td>
<td>等待输入/输出的进程的占用CPU百分比</td>
</tr>
<tr>
<td>0.0%hi</td>
<td>硬中断请求服务占用的CPU百分比</td>
</tr>
<tr>
<td>0.0%si</td>
<td>软中断请求服务占用的CPU百分比</td>
</tr>
<tr>
<td>0.0%st</td>
<td>st(Steal time)虚拟时间百分比，就是当有</td>
</tr>
</tbody></table>
<h5 id="1-5-3-4-第四行为物理内存信息"><a href="#1-5-3-4-第四行为物理内存信息" class="headerlink" title="1.5.3.4 第四行为物理内存信息"></a>1.5.3.4 第四行为物理内存信息</h5><p><img src="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/dev_ops/linux/2022-10-24-17-11-28_394c4025.png" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload alt="2022-10-24-17-11-28"><br>| 内容 | 说明 |<br>| — | — |<br>| Mem: 964344 total | 物理内存的问题，单位是KB |<br>| 170452 free | 空闲的物理内存数量 |<br>| 153476 used | 已经使用的物理内存数量 |<br>| 640416 buff/cache | 作为缓冲的内存数量，可以存放需要写入硬盘的数据，用来加速数据的写入 |</p>
<h5 id="1-5-3-5-第五行为交换分区信息"><a href="#1-5-3-5-第五行为交换分区信息" class="headerlink" title="1.5.3.5 第五行为交换分区信息"></a>1.5.3.5 第五行为交换分区信息</h5><p><img src="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/dev_ops/linux/2022-10-24-17-14-25_08fb3aa4.png" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload alt="2022-10-24-17-14-25"></p>
<table>
<thead>
<tr>
<th>内容</th>
<th>说明</th>
</tr>
</thead>
<tbody><tr>
<td>Swap: 0 total</td>
<td>总计的交换分区(虚拟内存)大小</td>
</tr>
<tr>
<td>0 free</td>
<td>空闲的交换分区大小</td>
</tr>
<tr>
<td>0 used</td>
<td>已经使用的交换分区大小</td>
</tr>
<tr>
<td>651744 avail Mem</td>
<td>把需要经常读取的数据从硬盘读到内存中，加速了数据的读取</td>
</tr>
</tbody></table>
<h3 id="1-6-kill-杀死进程"><a href="#1-6-kill-杀死进程" class="headerlink" title="1.6 kill - 杀死进程"></a>1.6 kill - 杀死进程</h3><h4 id="1-6-1-进程信号"><a href="#1-6-1-进程信号" class="headerlink" title="1.6.1 进程信号"></a>1.6.1 进程信号</h4><ul>
<li>  <code>kill -l</code> 查看可用的进程信号</li>
</ul>
<p><img src="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/dev_ops/linux/2022-10-24-17-18-15_38b8b9f1.png" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload alt="2022-10-24-17-18-15"></p>
<table>
<thead>
<tr>
<th>信号 代码</th>
<th>信号名称</th>
<th>说明</th>
<th>示例</th>
</tr>
</thead>
<tbody><tr>
<td>1</td>
<td>SIGHUP</td>
<td>该信号让进程立即关闭，然后重写读取配置文件后重启,平滑重启</td>
<td>kill -1 -HUP 进程号</td>
</tr>
<tr>
<td>2</td>
<td>SIGINT</td>
<td>程序终止信号，用于关闭前台进程,相当于ctrl+c</td>
<td></td>
</tr>
<tr>
<td>9</td>
<td>SIGKILL</td>
<td>用来立刻结束程序的运行，本信号不能阻塞、处理和忽略，一般用于强制中止</td>
<td></td>
</tr>
<tr>
<td>15</td>
<td>SIGTERM</td>
<td>正常结束进程的信号，kill命令的默认信号。如果不能正常中止，才会尝试SIGKILL信号</td>
<td></td>
</tr>
</tbody></table>
<h4 id="1-6-2-杀死进程"><a href="#1-6-2-杀死进程" class="headerlink" title="1.6.2 杀死进程"></a>1.6.2 杀死进程</h4><p>sleep.sh</p>
<figure class="highlight bash"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-ecnex1lacl5vph"></i><span>bash</span><div class="collapse show" id="collapse-ecnex1lacl5vph"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-meta">#!/bin/bash</span><br>i=0<br><span class="hljs-keyword">while</span> [ <span class="hljs-variable">$i</span> -le 1000 ]<br> <span class="hljs-keyword">do</span><br>   <span class="hljs-built_in">echo</span> $(<span class="hljs-built_in">date</span>)<br>   <span class="hljs-built_in">sleep</span> 1s<br> <span class="hljs-keyword">done</span><br><br></code></pre></td></tr></table></div></figure>
<figure class="highlight vim"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-25tq8qlacl5vph"></i><span>vim</span><div class="collapse show" id="collapse-25tq8qlacl5vph"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs vim"><span class="hljs-keyword">sh</span> <span class="hljs-keyword">sleep</span>.<span class="hljs-keyword">sh</span> &amp;<br><span class="hljs-keyword">ps</span> -ef | <span class="hljs-keyword">grep</span> <span class="hljs-keyword">sleep</span>.<span class="hljs-keyword">sh</span><br><br></code></pre></td></tr></table></div></figure>
<figure class="highlight bash"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-ns4ozalacl5vph"></i><span>bash</span><div class="collapse show" id="collapse-ns4ozalacl5vph"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-built_in">kill</span>  进程号<br><br></code></pre></td></tr></table></div></figure>

<h2 id="2-系统资源查看"><a href="#2-系统资源查看" class="headerlink" title="2. 系统资源查看 "></a>2. 系统资源查看 </h2><h3 id="2-1-vmstat-监控系统资源使用状态"><a href="#2-1-vmstat-监控系统资源使用状态" class="headerlink" title="2.1 vmstat - 监控系统资源使用状态"></a>2.1 vmstat - 监控系统资源使用状态</h3><ul>
<li>  监控系统资源使用状态</li>
<li>  vmstat [刷新延时 刷新次数]<br><img src="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/dev_ops/linux/2022-10-24-17-29-26_73987ed3.png" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload alt="2022-10-24-17-29-26"></li>
</ul>
<h4 id="2-1-1-procs-进程信息字段"><a href="#2-1-1-procs-进程信息字段" class="headerlink" title="2.1.1 (procs)进程信息字段"></a>2.1.1 (procs)进程信息字段</h4><table>
<thead>
<tr>
<th>分类</th>
<th>参数</th>
<th>含义</th>
</tr>
</thead>
<tbody><tr>
<td>procs</td>
<td>r</td>
<td>等待运行的进程数，数量越大，系统就越繁忙</td>
</tr>
<tr>
<td>procs</td>
<td>b</td>
<td>不可被唤醒的进程数量，数量越大，系统越繁忙</td>
</tr>
</tbody></table>
<h4 id="2-1-2-memory-内存信息字段"><a href="#2-1-2-memory-内存信息字段" class="headerlink" title="2.1.2 memory(内存信息字段)"></a>2.1.2 memory(内存信息字段)</h4><table>
<thead>
<tr>
<th>分类</th>
<th>参数</th>
<th>含义</th>
</tr>
</thead>
<tbody><tr>
<td>memory</td>
<td>swpd</td>
<td>使用的Swap空间的大小，单位KB</td>
</tr>
<tr>
<td>memory</td>
<td>free</td>
<td>空闲的内存容量，单位KB</td>
</tr>
<tr>
<td>memory</td>
<td>buff</td>
<td>缓冲的内存容量，单位KB</td>
</tr>
<tr>
<td>memory</td>
<td>cache</td>
<td>缓存的内存容量，单位KB</td>
</tr>
</tbody></table>
<h4 id="2-1-3-swap-交换分区信息"><a href="#2-1-3-swap-交换分区信息" class="headerlink" title="2.1.3 swap(交换分区信息)"></a>2.1.3 swap(交换分区信息)</h4><ul>
<li>  如果说si和so数越大说明数据经常要在磁盘和内存之间数据交换，系统性能就会越差</li>
</ul>
<table>
<thead>
<tr>
<th>分类</th>
<th>参数</th>
<th>含义</th>
</tr>
</thead>
<tbody><tr>
<td>swap</td>
<td>si(in)</td>
<td>从磁盘中交换到内存中的数据的数量，单位KB</td>
</tr>
<tr>
<td>swap</td>
<td>so(out)</td>
<td>从内存中交换到硬盘中的数据的数量，单位KB</td>
</tr>
</tbody></table>
<h4 id="2-1-4-io-磁盘读写"><a href="#2-1-4-io-磁盘读写" class="headerlink" title="2.1.4 io(磁盘读写)"></a>2.1.4 io(磁盘读写)</h4><ul>
<li>  bi和bo数越大，说明磁盘的I/O越繁忙</li>
</ul>
<table>
<thead>
<tr>
<th>分类</th>
<th>参数</th>
<th>含义</th>
</tr>
</thead>
<tbody><tr>
<td>io</td>
<td>bi(in)</td>
<td>从块设备读入数据的问题，单位是块</td>
</tr>
<tr>
<td>io</td>
<td>bo(out)</td>
<td>写到块设备的数据的总量，单位是块</td>
</tr>
</tbody></table>
<h4 id="2-1-5-system-系统信息字段"><a href="#2-1-5-system-系统信息字段" class="headerlink" title="2.1.5 system(系统信息字段)"></a>2.1.5 system(系统信息字段)</h4><ul>
<li>  in和cs数越大，说明系统与接口设备的通信越繁忙</li>
</ul>
<table>
<thead>
<tr>
<th>分类</th>
<th>参数</th>
<th>含义</th>
</tr>
</thead>
<tbody><tr>
<td>system</td>
<td>in(interrupt)</td>
<td>每秒被中断的进程次数</td>
</tr>
<tr>
<td>system</td>
<td>cs(switch)</td>
<td>每秒钟进行的事件切换次数</td>
</tr>
</tbody></table>
<h4 id="2-1-6-CPU-CPU信息字段"><a href="#2-1-6-CPU-CPU信息字段" class="headerlink" title="2.1.6 CPU(CPU信息字段)"></a>2.1.6 CPU(CPU信息字段)</h4><table>
<thead>
<tr>
<th>分类</th>
<th>参数</th>
<th>含义</th>
</tr>
</thead>
<tbody><tr>
<td>CPU</td>
<td>us(user)</td>
<td>非内核进程消耗CPU运算时间的百分比</td>
</tr>
<tr>
<td>CPU</td>
<td>sy(system)</td>
<td>内核进程消耗CPU运算时间的百分比</td>
</tr>
<tr>
<td>CPU</td>
<td>id(idea)</td>
<td>空闲CPU的百分比</td>
</tr>
<tr>
<td>CPU</td>
<td>wa(wait)</td>
<td>等待I/O所消耗的CPU百分比</td>
</tr>
<tr>
<td>CPU</td>
<td>st(steal)</td>
<td>被虚拟机偷走的CPU百分比</td>
</tr>
</tbody></table>
<h3 id="2-2-free-查看内存使用状态"><a href="#2-2-free-查看内存使用状态" class="headerlink" title="2.2 free - 查看内存使用状态"></a>2.2 free - 查看内存使用状态</h3><ul>
<li>  查看内存使用状态</li>
<li>  free [-b|-k|-m|-g]</li>
<li>选项<ul>
<li>  -b 以字节为单位</li>
<li>  -k 以KB字节为单位</li>
<li>  -m 以MB字节为单位</li>
<li>  -g 以GB字节为单位</li>
</ul>
</li>
</ul>
<p><img src="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/dev_ops/linux/2022-10-24-17-31-50_0222e34e.png" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload alt="2022-10-24-17-31-50"></p>
<h4 id="2-2-1-第一行"><a href="#2-2-1-第一行" class="headerlink" title="2.2.1 第一行"></a>2.2.1 第一行</h4><table>
<thead>
<tr>
<th>分类</th>
<th>参数</th>
<th>含义</th>
</tr>
</thead>
<tbody><tr>
<td>total</td>
<td>内存总数</td>
<td></td>
</tr>
<tr>
<td>used</td>
<td>已经使用的内存数</td>
<td></td>
</tr>
<tr>
<td>free</td>
<td>空闲的内存数</td>
<td></td>
</tr>
<tr>
<td>shared</td>
<td>多个进程共享的内存数</td>
<td></td>
</tr>
<tr>
<td>buffers</td>
<td>缓冲区内存数</td>
<td></td>
</tr>
<tr>
<td>cached</td>
<td>缓存内存数</td>
<td></td>
</tr>
</tbody></table>
<h4 id="2-2-2-第二行"><a href="#2-2-2-第二行" class="headerlink" title="2.2.2 第二行"></a>2.2.2 第二行</h4><table>
<thead>
<tr>
<th>参数</th>
<th>算法</th>
<th>含义</th>
</tr>
</thead>
<tbody><tr>
<td>- buffers/cache</td>
<td>第一行的used-buffers-cached</td>
<td>已经使用的要减去缓存和缓冲的内存量</td>
</tr>
<tr>
<td>+ buffers/cache</td>
<td>第一行的free+buffers+cached</td>
<td>空闲的要加上缓存和缓冲的内存量</td>
</tr>
</tbody></table>
<h4 id="2-2-3-第三行"><a href="#2-2-3-第三行" class="headerlink" title="2.2.3 第三行"></a>2.2.3 第三行</h4><table>
<thead>
<tr>
<th>分类</th>
<th>参数</th>
<th>含义</th>
</tr>
</thead>
<tbody><tr>
<td>total</td>
<td>swap总数，默认单位是K</td>
<td></td>
</tr>
<tr>
<td>used</td>
<td>已经使用的swap数，默认单位是K</td>
<td></td>
</tr>
<tr>
<td>free</td>
<td>空闲的swap数，默认单位是K</td>
<td></td>
</tr>
</tbody></table>
<h3 id="2-3-uname-查看内核相关信息"><a href="#2-3-uname-查看内核相关信息" class="headerlink" title="2.3 uname - 查看内核相关信息"></a>2.3 uname - 查看内核相关信息</h3><ul>
<li>  uname</li>
</ul>
<figure class="highlight apache"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-rg7qs4lacl5vph"></i><span>apache</span><div class="collapse show" id="collapse-rg7qs4lacl5vph"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs apache"><span class="hljs-comment"># uname -a</span><br><span class="hljs-attribute">Linux</span> linux <span class="hljs-number">3</span>.<span class="hljs-number">10</span>.<span class="hljs-number">0</span>-<span class="hljs-number">957</span>.<span class="hljs-number">21</span>.<span class="hljs-number">3</span>.el7.x86_64 #<span class="hljs-number">1</span> SMP Tue Jun <span class="hljs-number">18</span> <span class="hljs-number">16</span>:<span class="hljs-number">35</span>:<span class="hljs-number">19</span> UTC <span class="hljs-number">2019</span> x86_64 x86_64 x86_64 GNU/Linux<br><span class="hljs-comment"># uname -s</span><br><span class="hljs-attribute">Linux</span><br><span class="hljs-comment"># uname -r</span><br><span class="hljs-attribute">3</span>.<span class="hljs-number">10</span>.<span class="hljs-number">0</span>-<span class="hljs-number">957</span>.<span class="hljs-number">21</span>.<span class="hljs-number">3</span>.el7.x86_64<br></code></pre></td></tr></table></div></figure>
<p><img src="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/dev_ops/linux/2022-10-24-17-35-39_453e6f2e.png" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload alt="2022-10-24-17-35-39"></p>
<h3 id="2-4-file-查看操作系统位数"><a href="#2-4-file-查看操作系统位数" class="headerlink" title="2.4 file - 查看操作系统位数"></a>2.4 file - 查看操作系统位数</h3><figure class="highlight gradle"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-oukt00lacl5vph"></i><span>gradle</span><div class="collapse show" id="collapse-oukt00lacl5vph"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs gradle"><span class="hljs-keyword">file</span> <span class="hljs-regexp">/bin/</span>ls<br></code></pre></td></tr></table></div></figure>
<p><img src="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/dev_ops/linux/2022-10-24-17-35-11_b8c78ed0.png" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload alt="2022-10-24-17-35-11"></p>
<h3 id="2-5-查看发行版本"><a href="#2-5-查看发行版本" class="headerlink" title="2.5 查看发行版本"></a>2.5 查看发行版本</h3><figure class="highlight css"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-a69hfalacl5vph"></i><span>css</span><div class="collapse show" id="collapse-a69hfalacl5vph"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs css">lsb_release -<span class="hljs-selector-tag">a</span><br></code></pre></td></tr></table></div></figure>
<p><img src="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/dev_ops/linux/2022-10-24-17-36-11_ec65d11c.png" srcset="https://ikkiss.oss-cn-hangzhou.aliyuncs.com/images/myblog/loading.gif" lazyload alt="2022-10-24-17-36-11"></p>
<h3 id="2-6-查看发行版本"><a href="#2-6-查看发行版本" class="headerlink" title="2.6 查看发行版本"></a>2.6 查看发行版本</h3><figure class="highlight cmake"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-qbpvk6lacl5vph"></i><span>cmake</span><div class="collapse show" id="collapse-qbpvk6lacl5vph"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs cmake">yum <span class="hljs-keyword">install</span> redhat-lsb -y<br>lsb_release -v<br></code></pre></td></tr></table></div></figure>



<h2 id="4-实战任务"><a href="#4-实战任务" class="headerlink" title="4. 实战任务 "></a>4. 实战任务 </h2><h3 id="4-1-监控nginx"><a href="#4-1-监控nginx" class="headerlink" title="4.1 监控nginx"></a>4.1 监控nginx</h3><p>nginx.sh</p>
<figure class="highlight awk"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-rgo4eklacl5vph"></i><span>awk</span><div class="collapse show" id="collapse-rgo4eklacl5vph"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><code class="hljs awk"><span class="hljs-comment">#!/bin/bash</span><br>local nginx<br>nginx=`ps -ef |grep nginx|grep -v grep|wc -l`<br> <span class="hljs-keyword">if</span> [ <span class="hljs-variable">$nginx</span> -gt <span class="hljs-number">2</span> ];then<br>    echo <span class="hljs-string">&quot;your nginx is running&quot;</span><br>    <span class="hljs-keyword">exit</span> <span class="hljs-number">0</span><br> <span class="hljs-keyword">else</span><br>    <span class="hljs-regexp">/bin/</span>systemctl start nginx.service<br>    <span class="hljs-keyword">exit</span> <span class="hljs-number">1</span><br>fi<br><br></code></pre></td></tr></table></div></figure>

<h3 id="4-2-监控mysql状态"><a href="#4-2-监控mysql状态" class="headerlink" title="4.2 监控mysql状态"></a>4.2 监控mysql状态</h3><p>mysql.sh</p>
<figure class="highlight bash"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-kzscqplacl5vph"></i><span>bash</span><div class="collapse show" id="collapse-kzscqplacl5vph"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-meta">#!/bin/sh</span><br>PortNum=`netstat -lnt|grep 3306|<span class="hljs-built_in">wc</span> -l`<br><span class="hljs-keyword">if</span> [ <span class="hljs-variable">$PortNum</span> -eq 1 ]<br><span class="hljs-keyword">then</span><br> <span class="hljs-built_in">echo</span> <span class="hljs-string">&quot;mysqld is running.&quot;</span><br><span class="hljs-keyword">else</span><br> <span class="hljs-built_in">echo</span> <span class="hljs-string">&quot;mysqld is stoped.&quot;</span><br><span class="hljs-keyword">fi</span><br><br></code></pre></td></tr></table></div></figure>

<h3 id="4-3-mysql备份脚本"><a href="#4-3-mysql备份脚本" class="headerlink" title="4.3 mysql备份脚本"></a>4.3 mysql备份脚本</h3><p>mysql_backup.sh</p>
<figure class="highlight bash"><i class="iconfont icon-top" type="button" data-toggle="collapse" data-target="#collapse-kswen5lacl5vph"></i><span>bash</span><div class="collapse show" id="collapse-kswen5lacl5vph"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-meta">#!/bin/bash</span><br>DATE=$(<span class="hljs-built_in">date</span> +%F_%H-%M-%S)<br>HOST=127.0.0.1<br>DB=<span class="hljs-built_in">test</span><br>USER=root<br>PASS=abcd1<span class="hljs-comment">#EFG</span><br>MAIL=<span class="hljs-string">&quot;83687401@qq.com&quot;</span><br>BACKUP_DIR=/data/db_backup<br><span class="hljs-keyword">if</span> [ ! -d <span class="hljs-string">&quot;<span class="hljs-variable">$BACKUP_DIR</span>&quot;</span> ];<span class="hljs-keyword">then</span><br> <span class="hljs-built_in">mkdir</span> -p <span class="hljs-variable">$BACKUP_DIR</span><br><span class="hljs-keyword">fi</span><br>SQL_FILE=<span class="hljs-variable">$&#123;DB&#125;</span>_FULL_<span class="hljs-variable">$DATE</span>.sql<br>BAK_FILE=<span class="hljs-variable">$&#123;DB&#125;</span>_FULL_<span class="hljs-variable">$DATE</span>.zip<br><span class="hljs-built_in">cd</span> <span class="hljs-variable">$BACKUP_DIR</span><br><span class="hljs-keyword">if</span> mysqldump -h<span class="hljs-variable">$HOST</span> -u<span class="hljs-variable">$USER</span> -p<span class="hljs-variable">$PASS</span> -B <span class="hljs-variable">$DB</span> &gt; <span class="hljs-variable">$SQL_FILE</span>; <span class="hljs-keyword">then</span><br>  zip <span class="hljs-variable">$BAK_FILE</span> <span class="hljs-variable">$SQL_FILE</span> &amp;&amp; <span class="hljs-built_in">rm</span> -rf <span class="hljs-variable">$SQL_FILE</span><br>  <span class="hljs-keyword">if</span> [ ! -s <span class="hljs-variable">$BAK_FILE</span> ]; <span class="hljs-keyword">then</span><br>    <span class="hljs-built_in">echo</span> <span class="hljs-string">&quot;<span class="hljs-variable">$DATE</span> 备份失败&quot;</span> | mail -s <span class="hljs-string">&quot;备份失败&quot;</span> <span class="hljs-variable">$MAIL</span><br>  <span class="hljs-keyword">fi</span><br><span class="hljs-keyword">else</span><br>  <span class="hljs-built_in">echo</span> <span class="hljs-string">&quot;<span class="hljs-variable">$DATE</span> 备份失败&quot;</span> | mail -s <span class="hljs-string">&quot;备份失败&quot;</span> <span class="hljs-variable">$MAIL</span><br><span class="hljs-keyword">fi</span><br>find <span class="hljs-variable">$BACKUP_DIR</span> -name <span class="hljs-string">&#x27;*.zip&#x27;</span> -ctime +14 -<span class="hljs-built_in">exec</span> <span class="hljs-built_in">rm</span> &#123;&#125; \;<br><br></code></pre></td></tr></table></div></figure>
                
              </div>
            
            <hr/>
            <div>
              <div class="post-metas my-3">
  
    <div class="post-meta mr-3 d-flex align-items-center">
      <i class="iconfont icon-category"></i>
      

<span class="category-chains">
  
  
    
      <span class="category-chain">
        
  <a href="/categories/%E8%BF%90%E7%BB%B4/" class="category-chain-item">运维</a>
  
  
    <span>></span>
    
  <a href="/categories/%E8%BF%90%E7%BB%B4/linux/" class="category-chain-item">linux</a>
  
  

  

      </span>
    
  
</span>

    </div>
  
  
    <div class="post-meta">
      <i class="iconfont icon-tags"></i>
      
        <a href="/tags/%E8%BF%90%E7%BB%B4/">#运维</a>
      
        <a href="/tags/linux/">#linux</a>
      
    </div>
  
</div>


              
  

  <div class="license-box my-3">
    <div class="license-title">
      <div>07.进程管理</div>
      <div>http://81.68.132.127/2022/10/24/dev_ops/linux/进程管理/</div>
    </div>
    <div class="license-meta">
      
        <div class="license-meta-item">
          <div>作者</div>
          <div>Ikki</div>
        </div>
      
      
        <div class="license-meta-item license-meta-date">
          <div>发布于</div>
          <div>2022年10月24日</div>
        </div>
      
      
        <div class="license-meta-item license-meta-date">
          <div>更新于</div>
          <div>2022年10月24日</div>
        </div>
      
      
        <div class="license-meta-item">
          <div>许可协议</div>
          <div>
            
              
              
                <a target="_blank" href="https://creativecommons.org/licenses/by/4.0/">
                  <span class="hint--top hint--rounded" aria-label="BY - 署名">
                    <i class="iconfont icon-by"></i>
                  </span>
                </a>
              
            
          </div>
        </div>
      
    </div>
    <div class="license-icon iconfont"></div>
  </div>



              
                <div class="post-prevnext my-3">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2022/10/24/dev_ops/linux/crontab%E7%B3%BB%E7%BB%9F%E5%AE%9A%E6%97%B6%E4%BB%BB%E5%8A%A1/" title="08.crontab定时任务">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">08.crontab定时任务</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2022/10/24/dev_ops/linux/%E8%BD%AF%E4%BB%B6%E5%8C%85%E7%AE%A1%E7%90%86/" title="06.软件包管理">
                        <span class="hidden-mobile">06.软件包管理</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
  <article id="comments" lazyload>
    
  <div id="valine"></div>
  <script type="text/javascript">
    Fluid.utils.loadComments('#valine', function() {
      Fluid.utils.createScript('https://lib.baomitu.com/valine/1.5.1/Valine.min.js', function() {
        var options = Object.assign(
          {"appId":"6KzYWc2oaEBaHgNl4UIicMJC-gzGzoHsz","appKey":"vJ4FIwKeHRmHraCJraAsjyZ7","path":"window.location.pathname","placeholder":"请输入你的评论\n昵称为必填项目(输入QQ号码可以自动获取昵称和邮箱)\n虽然email不是必选，但是填写了email可以收到推送通知哦！","avatar":"retro","meta":["nick","mail","link"],"requiredFields":[],"pageSize":10,"lang":"zh-CN","highlight":true,"recordIP":true,"serverURLs":"","emojiCDN":null,"emojiMaps":null,"enableQQ":true},
          {
            el: "#valine",
            path: window.location.pathname
          }
        )
        new Valine(options);
        Fluid.utils.waitElementVisible('#valine .vcontent', () => {
          var imgSelector = '#valine .vcontent img:not(.vemoji)';
          Fluid.plugins.imageCaption(imgSelector);
          Fluid.plugins.fancyBox(imgSelector);
        })
      });
    });
  </script>
  <noscript>Please enable JavaScript to view the comments</noscript>


  </article>


          </article>
        </div>
      </div>
    </div>

    <div class="side-col d-none d-lg-block col-lg-2">
      

    </div>
  </div>
</div>





  



  



  



  



  







    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v" for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>

    

    
  </main>

  <footer>
    <div class="footer-inner">
  
    <div class="footer-content">
      IKKI-专业BUG开发
    </div>
  
  
    <div class="statistics">
  
  

  
    
      <span id="busuanzi_container_site_pv" style="display: none">
        总访问量 
        <span id="busuanzi_value_site_pv"></span>
         次
      </span>
    
    
      <span id="busuanzi_container_site_uv" style="display: none">
        总访客数 
        <span id="busuanzi_value_site_uv"></span>
         人
      </span>
    
    
  
</div>

  
  
  
</div>

  </footer>

  <!-- Scripts -->
  
  <script  src="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://lib.baomitu.com/jquery/3.6.0/jquery.min.js" ></script>
<script  src="https://lib.baomitu.com/twitter-bootstrap/4.6.1/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>


  <script  src="https://lib.baomitu.com/typed.js/2.0.12/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var subtitle = document.getElementById('subtitle');
      if (!subtitle || !typing) {
        return;
      }
      var text = subtitle.getAttribute('data-typed-text');
      
        typing(text);
      
    })(window, document);
  </script>




  
    <script  src="/js/img-lazyload.js" ></script>
  




  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/tocbot/4.18.2/tocbot.min.js', function() {
    var toc = jQuery('#toc');
    if (toc.length === 0 || !window.tocbot) { return; }
    var boardCtn = jQuery('#board-ctn');
    var boardTop = boardCtn.offset().top;

    window.tocbot.init(Object.assign({
      tocSelector     : '#toc-body',
      contentSelector : '.markdown-body',
      linkClass       : 'tocbot-link',
      activeLinkClass : 'tocbot-active-link',
      listClass       : 'tocbot-list',
      isCollapsedClass: 'tocbot-is-collapsed',
      collapsibleClass: 'tocbot-is-collapsible',
      scrollSmooth    : true,
      includeTitleTags: true,
      headingsOffset  : -boardTop,
    }, CONFIG.toc));
    if (toc.find('.toc-list-item').length > 0) {
      toc.css('visibility', 'visible');
    }

    Fluid.events.registerRefreshCallback(function() {
      if ('tocbot' in window) {
        tocbot.refresh();
        var toc = jQuery('#toc');
        if (toc.length === 0 || !tocbot) {
          return;
        }
        if (toc.find('.toc-list-item').length > 0) {
          toc.css('visibility', 'visible');
        }
      }
    });
  });
</script>


  <script src=https://lib.baomitu.com/clipboard.js/2.0.11/clipboard.min.js></script>

  <script>Fluid.plugins.codeWidget();</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/anchor-js/4.3.1/anchor.min.js', function() {
    window.anchors.options = {
      placement: CONFIG.anchorjs.placement,
      visible  : CONFIG.anchorjs.visible
    };
    if (CONFIG.anchorjs.icon) {
      window.anchors.options.icon = CONFIG.anchorjs.icon;
    }
    var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
    var res = [];
    for (var item of el) {
      res.push('.markdown-body > ' + item.trim());
    }
    if (CONFIG.anchorjs.placement === 'left') {
      window.anchors.options.class = 'anchorjs-link-left';
    }
    window.anchors.add(res.join(', '));

    Fluid.events.registerRefreshCallback(function() {
      if ('anchors' in window) {
        anchors.removeAll();
        var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
        var res = [];
        for (var item of el) {
          res.push('.markdown-body > ' + item.trim());
        }
        if (CONFIG.anchorjs.placement === 'left') {
          anchors.options.class = 'anchorjs-link-left';
        }
        anchors.add(res.join(', '));
      }
    });
  });
</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.js', function() {
    Fluid.plugins.fancyBox();
  });
</script>


  <script>Fluid.plugins.imageCaption();</script>

  <script  src="/js/local-search.js" ></script>

  <script defer src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" ></script>




  
<script src="/fluid/js/star.js"></script>



<!-- 主题的启动项，将它保持在最底部 -->
<!-- the boot of the theme, keep it at the bottom -->
<script  src="/js/boot.js" ></script>


  

  <noscript>
    <div class="noscript-warning">博客在允许 JavaScript 运行的环境下浏览效果更佳</div>
  </noscript>
</body>
</html>
